package com.zhao.service;

import com.zhao.pojo.Dept;
import com.zhao.service.Impl.DeptClientServiceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @interfaceName DeptCilentService
 * @author:赵培舒
 * @date:Created in 2021/4/20 21:03
 * @Email:stevezhao@nyist.edu.cn
 * @description：Feign
 * @version: 1.0
 */

@Component  //注册到spring中
@FeignClient(value = "SPRINGCLOUD-PROVIDER-DEPT",fallbackFactory = DeptClientServiceFallbackFactory.class) //注册到spring中
public interface DeptClientService {

    @GetMapping("/dept/get/{id}")
    public Dept queryById(@PathVariable("id") Long id);

    @GetMapping("/dept/list")
    public List<Dept> queryAll();

    @PostMapping("/dept/add")
    public boolean addDept(Dept dept);

}
